package cn.tedu.vrd07.mapper;

import cn.tedu.vrd07.entity.Product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProductMapper {

    @Insert("insert into product values(null,#{title},#{author},#{intro},#{url},0,0,#{created},#{categoryId})")
    void insert(Product product);

    @Select("select id,title,author,url,created from product")
    List<Product> select();

    @Delete("delete from product where id=#{id}")
    void delete(int id);
}
